<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>后台用户管理-<?php echo (C("cms_name")); ?></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel='stylesheet' type='text/css' href='__PUBLIC__/Admin/css/admin_style.css' />
	<script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Admin/js/function.js"></script>
	<script charset="utf-8" src="__PUBLIC__/vendor/datepicker/WdatePicker.js"></script>
	<style>td{ height:22px; line-height:22px}</style>
</head>
<body>
	<table width="98%" border="0" cellpadding="9" cellspacing="1" class="table">
		<tr>
			<td colspan="11" class="table_title">
				<span class="fl">订单管理</span>
				<span class="fr">
					<!--<a href="<?php echo U('Goods/add');?>">添加物品</a>-->
				</span>

			</td>
			</tr>
			<tr>
				
				<td colspan="11" class="table_title" >
					<form name="searchForm" id="searchForm" action="">
					<input type="hidden" name="g" value="Admin" />
					<input type="hidden" name="m" value="Orders" />
					<input type="hidden" name="a" value="index" />
				    
				    订单号<input name="search[order_sn]" type="text" id="order_sn" size="25" value="<?php echo ($_GET['search']['order_sn']); ?>">
				   <!-- 收货人<input name="search[receive_name]" type="text" id="receive_name" size="10" value="<?php echo ($_GET['search']['receive_name']); ?>">-->
				    
				    <!--商品编号<input name="search[goods_id]" type="text" id="goods_id" size="15" value="<?php echo ($_GET['search']['goods_id']); ?>">-->
					<!--订单状态
					<select name="search[order_status]" id="order_status">
      <option value="-1" <?php if(($_GET["search"]["order_status"]) == "-1"): ?>selected<?php endif; ?>>全部订单</option>
      <option value="0" <?php if(($_GET["search"]["order_status"]) == "0"): ?>selected<?php endif; ?>>待支付</option>
      <option value="1" <?php if(($_GET["search"]["order_status"]) == "1"): ?>selected<?php endif; ?>>已支付，未确认</option>
      <option value="2" <?php if(($_GET["search"]["order_status"]) == "2"): ?>selected<?php endif; ?>>已确认，待发货</option>
      <option value="3" <?php if(($_GET["search"]["order_status"]) == "3"): ?>selected<?php endif; ?>>配送中</option>
      <option value="4" <?php if(($_GET["search"]["order_status"]) == "4"): ?>selected<?php endif; ?>>已签收</option>
      <option value="5" <?php if(($_GET["search"]["order_status"]) == "5"): ?>selected<?php endif; ?>>交易已取消</option>

      <option value="6" <?php if(($_GET["search"]["order_status"]) == "6"): ?>selected<?php endif; ?>>未发货退款处理中</option>
      <option value="7" <?php if(($_GET["search"]["order_status"]) == "7"): ?>selected<?php endif; ?>>未发货退款成功</option>
		<option value="8" <?php if(($_GET["search"]["order_status"]) == "8"): ?>selected<?php endif; ?>>已发货退款处理中</option>
		<option value="9" <?php if(($_GET["search"]["order_status"]) == "9"): ?>selected<?php endif; ?>>已发货退款成功</option>
		<option value="999" <?php if(($_GET["search"]["order_status"]) == "999"): ?>selected<?php endif; ?>>未确认与待发货</option>
          </select>-->

          		

    			下单时间
    			<input id="start_time" name="search[start_time]" type="text" onClick="WdatePicker({dateFmt:'yyyy-M-d HH:mm'})" value="<?php echo ($_GET['search']['start_time']); ?>" />~
    			<input id="end_time" name="search[end_time]" type="text" onClick="WdatePicker({dateFmt:'yyyy-M-d HH:mm'})" value="<?php echo ($_GET['search']['end_time']); ?>" />
			    </br>
			  <!--  购买类型
          		<select name="search[group_buy]" id="group_buy">
      <option value="-1" <?php if(($_GET["search"]["group_buy"]) == "-1"): ?>selected<?php endif; ?>>全部</option>
      <option value="1" <?php if(($_GET["search"]["group_buy"]) == "1"): ?>selected<?php endif; ?>>团购购买</option>
      <option value="0" <?php if(($_GET["search"]["group_buy"]) == "0"): ?>selected<?php endif; ?>>单独购买</option>
    </select>-->
				<!--团购状态
          		<select name="search[status]" id="status">
          		 <option value="-1" <?php if(($_GET["search"]["status"]) == "-1"): ?>selected<?php endif; ?>>全部</option>
      <option value="0" <?php if(($_GET["search"]["status"]) == "0"): ?>selected<?php endif; ?>>团购进行中</option>
      <option value="1" <?php if(($_GET["search"]["status"]) == "1"): ?>selected<?php endif; ?>>团购成功</option>
      <option value="2" <?php if(($_GET["search"]["status"]) == "2"): ?>selected<?php endif; ?>>团购失败</option>
    </select>
-->

				      </br>
				    <input type="submit" value=" 搜索 " class="button" />
					<!--<input type="button" id="export" value=" 导出 " class="button" />-->
				  </form>

				</td>

			</tr>
			<tr class="list_head ct">
				<td width="70">ID</td>
				<td >订单编号</td>
				<td >物品名称</td>
				<td >购买用户</td>
				<td >订单金额</td>
				<td >实付金额</td>
				<td >订单类型</td>
				<td >下单时间</td>
				<td >支付时间</td>
				<td>订单状态</td>
				<!--<td>管理操作</td>-->
			</tr>
	    <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr class='tr'>
				<td align='center'><?php echo ($vo["order_id"]); ?></td>
				<td ><?php echo ($vo["order_sn"]); ?></td>
				<!--<td ><?php echo (getgoodsfield('goods_name',$vo["order_goods"])); ?></td>-->
                <td ><?php echo ($vo["tao_name"]); ?></td>
				<td ><?php echo ($vo["nickname"]); ?></td>
				<td align='center'><?php echo ($vo["order_amount"]); ?>元</td>
				<td align='center'><?php echo ($vo["pay_amount"]); ?>元</td>
				<td align='center'>
                	<?php if(($vo["group_buy"]) == "0"): ?>个人购买<?php else: ?>个人购买<?php endif; ?>
					<!--<?php if(($vo["group_buy"]) == "1"): ?>团购
					<?php if(($vo["group_header"]) == "1"): ?>（团长）
					<?php if(($vo["order_group_order_id"]) == "0"): ?>（未成团）<?php else: ?>
					（已成团）<?php endif; ?>
					<?php else: ?>(参团)<?php endif; else: ?>个人购买<?php endif; ?>-->
				</td>
				<td align='center'><?php echo (date('Y-m-d H:i:s',$vo["order_time"])); ?></td>
				<td align='center'>
					<?php if(($vo["pay_time"]) != "0"): echo (date('Y-m-d H:i:s',$vo["pay_time"])); ?>
						<?php else: ?>
						无<?php endif; ?>
					
				</td>
				<td align='center'>
					
					<?php switch($vo["order_status"]): case "1": ?>已支付<?php break;?>
					    <!--<?php case "0": ?>待支付<?php break;?>
					    <?php case "1": ?>已支付，未确认<?php break;?>
					    <?php case "2": ?>已确认，待发货<?php break;?>
					    <?php case "3": ?>配送中<?php break;?>
					    <?php case "4": ?>已签收<?php break;?>
					    <?php case "5": ?>交易已取消<?php break;?>
					    <?php case "6": ?>未发货退款处理中<?php break;?>
					    <?php case "7": ?>未发货退款成功<?php break;?>
					    <?php case "8": ?>已发货退款处理中<?php break;?>
					    <?php case "9": ?>已发货退款成功<?php break;?>-->
					    
					     <?php default: ?>default<?php endswitch;?>
					 <!--<?php if($vo['order_status'] != 0 && $vo['order_status'] != 5): ?>（<?php if(($vo["group_buy"]) == "1"): ?>团购 
					<?php if($vo['status'] == 0 ): ?>进行中
						<?php elseif($vo['status'] == 1): ?><span style="color:green;">成功</span>
					    <?php else: ?> <span style="color:red;">失败</span><?php endif; ?>

					 <?php else: ?>个人<?php endif; ?>）<?php endif; ?>-->
				</td>
				
				<!-- <td align='center'>
					<a href="<?php echo U('Orders/edit/',array('id'=>$vo['order_id']));?>">查看</a>
					<!-- <a href="javascript:void(0)" onclick="return confirmurl('<?php echo U('Goods/del/',array('id'=>$vo['goods_id']));?>','确定删除该商品吗？')">删除</a> 
				</td>-->
			</tr><?php endforeach; endif; else: echo "" ;endif; ?>
		<tr class="tr">
          <td colspan="11" class="pages">
            <?php echo ($page); ?>
          </td>
        </tr>
		</table>
		<script>var version='<?php echo (C("cms_var")); ?>';</script>
		<style>
#footer, #footer a:link, #footer a:visited {
	clear:both;
	color:#0072e3;
	font:12px/1.5 Arial;
	margin-top:10px;
	text-align:center;
	white-space:nowrap;
}
</style>
<div id="footer">程序版本：<?php echo (C("cms_var")); ?>&nbsp;&nbsp;&nbsp;&nbsp;Copyright © 2017-2022 All rights reserved</div>
<script>
	$('#export').click(function(){
		location.href = '?' + $('#searchForm').serialize() + '&export=1';

	});
</script>
</body>
	</html>